//
//  UIBarButtonItem+Util.m
//  CD1505Weibo
//
//  Created by 千锋 on 15/12/30.
//  Copyright (c) 2015年 Hawie. All rights reserved.
//

#import "UIBarButtonItem+Util.h"

@implementation UIBarButtonItem (Util)
+(UIBarButtonItem*)generateBarButtonItemWithNormaImageName:(NSString*)norImgName gighlightedImageName:(NSString*)hlImgName
{
    UIButton*btn=[UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:[UIImage imageNamed:norImgName] forState:UIControlStateNormal];
    CGSize size=btn.currentImage.size;
    btn.frame=CGRectMake(0, 0, size.width, size.height);
    [btn setImage:[UIImage imageNamed:hlImgName] forState:UIControlStateHighlighted];
    UIBarButtonItem*item=[[UIBarButtonItem alloc]initWithCustomView:btn];
    return item;
}
@end
